package com.quectel.core.module.entranceguard.dto;

import com.quectel.core.module.device.dto.DeviceDto;
import com.quectel.core.module.village.dto.VillageRoomDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 访客申请记录表
 *
 * @author rananxin
 * @email: ryan.ran@quectel.com
 * @date 2021-12-24 10:46:50
 */
@Data
@Schema
public class EntranceGuardVisitorApplyRecordDto implements Serializable {

    /**
     *
     */
    @Schema(description = "")
    private Long id;

    @Schema(description = "加密id")
    private String encryptId;

    @Schema(description = "租户id")
    private Long tenantId;

    /**
     * 申请人id
     */
    @Schema(description = "申请人id")
    private Long applyUserId;

    /**
     * 申请人类型 0管理员1住户
     */
    @Schema(description = "申请人类型 1管理员2住户")
    private Byte applyUserType;

    /**
     * 申请人姓名
     */
    @Schema(description = "申请人姓名")
    private String applyUsername;

    /**
     * 访客id
     */
    @Schema(description = "访客id")
    private Long visitorId;

    /**
     * 小区id
     */
    @Schema(description = "小区id")
    private Long villageId;

    /**
     * 小区id
     */
    @Schema(description = "楼栋id")
    private Long buildingId;

    /**
     * 小区id
     */
    @Schema(description = "楼层id")
    private Long floorId;

    /**
     * 房间信息
     */
    @Schema(description = "房间信息")
    private Long roomId;

    /**
     * 本次有效时间
     */
    @Schema(description = "本次有效时间")
    private Date startTime;

    /**
     * 本次有效时间
     */
    @Schema(description = "本次有效时间")
    private Date endTime;

    /**
     * 是否有效
     */
    @Schema(description = "使用范围 1过期 2生效中 3未到生效时间")
    private Byte accessibleScope;

    /**
     * 本次授权的设备列表
     */
    @Schema(description = "本次授权的设备列表")
    private String deviceIds;

    /**
     * 二维码信息
     */
    @Schema(description = "二维码信息")
    private String qrCode;

    /**
     * 访问缘由
     */
    @Schema(description = "访问缘由")
    private String reason;

    /**
     *
     */
    @Schema(description = "")
    private String creator;

    /**
     *
     */
    @Schema(description = "")
    private Date createTime;

    /**
     *
     */
    @Schema(description = "")
    private String editor;

    /**
     *
     */
    @Schema(description = "")
    private Date editTime;

    @AllArgsConstructor
    public enum ApplyUserTypeEnum {
        ADMIN((byte) 1),
        HOUSEHOLD((byte) 2);

        @Getter
        private Byte type;
    }

    @AllArgsConstructor
    public enum AccessibleScopeEnum {
        OVERDUE((byte) 1),
        EFFECT((byte) 2),
        NOT_EFFECT((byte) 3);

        @Getter
        private Byte type;
    }

    /************非数据库字段 start ************/

    @Schema(description = "房间信息")
    private VillageRoomDto villageRoom;

    @Schema(description = "授权的设备列表")
    private List<DeviceDto> authDevices;

    @Schema(description = "访客信息")
    private VisitorDto visitor;

    /************非数据库字段 end **************/
}
